<include file="Public:header" />

<script type="text/javascript" src="__ROOT__/statics/js/swfupload/swfupload.js"></script>
<script type="text/javascript" src="__ROOT__/statics/js/swfupload/goodsupload/swfupload.queue.js"></script>
<script type="text/javascript" src="__ROOT__/statics/js/swfupload/goodsupload/fileprogress.js"></script>
<script type="text/javascript" src="__ROOT__/statics/js/swfupload/goodsupload/handlers.js"></script>

<script type="text/javascript" src="__ROOT__/statics/js/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript">
	//编辑器
	KE.show({
		id : 'detail',
		//imageUploadJson : 'index.php?m=attachment&a=keupload',
		//fileManagerJson : 'index.php?m=attachment&a=file_manager&',
		allowFileManager : true,
		afterCreate : function(id) {
			KE.event.ctrl(document, 13, function() {
				KE.util.setData(id);
				document.forms['myform'].submit();
			});
			KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
				KE.util.setData(id);
				document.forms['myform'].submit();
			});
		}
	});
</script>
<form action="{:u('goods/update')}" method="post" name="myform" id="myform" enctype="multipart/form-data" >
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
	<li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',3,1);">{$Think.lang.general_info}</li>
    <li id="tab_setting_2" onclick="SwapTab('setting','on','',3,2);">{$Think.lang.goods_detail}</li>
	<li id="tab_setting_3" onclick="SwapTab('setting','on','',3,3);">{$Think.lang.goods_seo}</li>
</ul>

<div id="div_setting_1" class="contentList pad-10">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
	<tr> 
      <th width="100">{$Think.lang.goods_name} :</th>
      <td><input type="text" name="name" id="name" class="input-text" size="60" value="{$goods_info.name}"></td>
      <td rowspan="8">
      	<table cellpadding=3 cellspacing=3 >
		<tr>
			<td>
			<table>
				<tr>
					<td width="120">
						<div id="divStatus" style="display:none;"></div>
						<input id="btnCancel" type="hidden" />
						<span id="image_browse"></span>
					</td>
					<td>
						<div class="fieldset flash" id="fsUploadProgress" style="display:none;" ></div>
						<div id="uploaderimg"></div>
					</td>
				</tr>
			</table>
			</td>
		</tr>
		<tr>
			<td>
			<img src="__ROOT__/statics/admin/images/nopic.gif" width="300" height="230" id="goods_img_box" />
			<input type="hidden" name="gallery_id" id="gallery_id" value="1" />
			</td>
		</tr>
		<tr>
			<td>
				<!-- 图片列表 -->
				<div id="gallery_list" class="gallery_list" >
					<iterate name="img_list" id="img_gallery">				
						<div>
						<input type='hidden' value='{$img_gallery.id}' name='goods_gallerys[]' />
						<img src='__ROOT__{$img_gallery.thumb_url}' onclick='setgallery({$img_gallery.id});' /><br /><a href='javascript:;' onclick='delgallery({$img_gallery.id},this)'>{$Think.lang._DELETE_DATA}</a>
						</div>							
					</iterate>				
				</div>
				<!-- 图片列表 -->
			</td>
		</tr>
		</table>
        <script type="text/javascript">
		var settings = {
				flash_url : ROOT_PATH+"/statics/js/swfupload/swfupload.swf",
				upload_url: APP,
				file_types : "*.jpg;*.gif",
				file_upload_limit : 100,
				file_queue_limit : 100,
				custom_settings : {
					progressTarget : "fsUploadProgress",
					cancelButtonId : "btnCancel"
				},
				debug: false,
				button_image_url: ROOT_PATH+"/statics/admin/images/uploadbtn.png",
				button_width: "100",
				button_height: "30",
				button_placeholder_id: "image_browse",
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,
				queue_complete_handler : queueComplete	// Queue plugin event
			};
			var swfu = new SWFUpload(settings);
		</script>
		<!-- 图片上传块 -->
      </td>
    </tr>
    <tr> 
      <th>{$Think.lang.goods_sn} :</th>
      <td><input type="text" name="goods_sn" id="goods_sn" class="input-text" value="{$goods_info.goods_sn}"></td>
      </tr>
    <tr> 
      <th>{$Think.lang.goods_cate} :</th>
      <td>
        <select name="cate_id">
          <option value="1">商品分类</option>
          </select> 
      </td>
      </tr>
    <tr> 
      <th>{$Think.lang.goods_brand} :</th>
      <td>
        <select name="brand_id">
          <option value="1">商品品牌</option>
          </select> 
      </td>
      </tr>
    <tr> 
      <th>{$Think.lang.shop_price} :</th>
      <td><input type="text" name="sprice" id="shop_price" class="input-text" value="{$goods_info.sprice}"></td>
      </tr>
    <tr> 
      <th>{$Think.lang.market_price} :</th>
      <td><input type="text" name="mprice" id="market_price" class="input-text" value="{$goods_info.mprice}"></td>
      </tr>
    <tr> 
      <th>{$Think.lang.goods_stock} :</th>
      <td><input type="text" name="stock" id="stock" class="input-text" value="{$goods_info.stock}"></td>
      </tr>
</table>
</div>
<div id="div_setting_2" class="contentList pad-10 hidden">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
	<tr> 
      <td><textarea name="detail" id="detail" style="width:80%;height:350px;visibility:hidden;">{$goods_info.detail}</textarea></td>
    </tr>
</table>
</div>
<div id="div_setting_3" class="contentList pad-10 hidden">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
	<tr>
      <th width="100">{$Think.lang.seo_title} :</th>
      <td><input type="text" name="seo_title" id="seo_title" class="input-text" size="60" value="{$goods_info.seo_title}"></td>
    </tr>
    <tr>
      <th>{$Think.lang.seo_keys} :</th>
      <td><input type="text" name="seo_keys" id="seo_keys" class="input-text" size="60" value="{$goods_info.seo_keys}"></td>
    </tr>
    <tr>
      <th>{$Think.lang.seo_desc} :</th>
      <td><textarea name="seo_desc" id="seo_desc" cols="80" rows="8">{$goods_info.seo_desc}</textarea></td>
    </tr>
</table>
</div>
<input type="hidden" name="id" value="{$goods_info.id}" />
<div class="bk15"></div>
<div class="btn"><input type="submit" value="{$Think.lang.submit}" name="dosubmit" class="button" id="dosubmit"></div>
</div>
</div>
</form>
<script type="text/javascript">
function SwapTab(name,cls_show,cls_hide,cnt,cur){
    for(i=1;i<=cnt;i++){
		if(i==cur){
			 $('#div_'+name+'_'+i).show();
			 $('#tab_'+name+'_'+i).attr('class',cls_show);
		}else{
			 $('#div_'+name+'_'+i).hide();
			 $('#tab_'+name+'_'+i).attr('class',cls_hide);
		}
	}
}
</script>
</body>
</html>